package com.framework.controller.newcontroller;


import com.framework.exception.util.RespResult;
import com.framework.service.app.AppDiscoverArticleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


/**
 *
 * @author wq
 */
@Api(value="发现模块", tags={"发现模块"})
@RestController
@RequestMapping("new/discover")
public class DiscoverController {
    @Autowired
    private AppDiscoverArticleService appDiscoverArticleService;


    @GetMapping("user/getDiscoverInfo")
    @ApiOperation("获取发现页面信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name="token",value="登录所产生的token",dataType ="string",paramType = "query",required = true),
            @ApiImplicitParam(name="pageNo",value="页数 从1开始",dataType ="integer",paramType = "query",required = true)
    })
    public RespResult getDiscoverInfo(String token,Integer pageNo) throws IllegalAccessException {
        Map<String,Object> map= appDiscoverArticleService.getDiscoverInfo(token,pageNo);
        return RespResult.ok(map);
    }
}
